﻿/*******************************************************************************
 * Copyright © 2016 DJY 版权所有
 * Author: DJY
 * Description: 后台管理系统
 * Website：http://www.djyweb.cn
*********************************************************************************/
using System.Configuration;
using System.Web;

namespace DJY.Code
{
    public sealed class Licence
    {
        public static bool IsLicence(string key)
        {
            string host = HttpContext.Current.Request.Url.Host.ToLower();
            if (host.Equals("localhost"))
                return true;
            return ConfigurationManager.AppSettings["LicenceKey"] == key;
        }

        public static string GetLicence()
        {
            return ConfigHelper.GetValue("LicenceKey");
        }
    }
}
